home *** CD-ROM | disk | FTP | other *** search
/ Aminet 9 / Aminet 9 (1995)(GTI - Schatztruhe)[!][Dec 1995].iso / Aminet / game / misc / PinHi.lha / PinHi.e < prev    next >
Text File  |  1995-11-01  |  1KB  |  68 lines

  1. /* PinHi - show highscores of DI's Pinball Illusions
  2. doesn't use nonvolatile.library although it *should* (anyone send me the
  3. NV-Autodocs and -Includes?) */
  4.  
  5. OPT OSVERSION=36
  6.  
  7. MODULE 'dos/dos'
  8.  
  9. DEF buff[50]:ARRAY
  10.  
  11. PROC main()
  12. DEF ver,nv_loc[120]:ARRAY,lock,oldlock
  13.  
  14.     ver:='$VER: PinHi 1.0 (1.11.95)'
  15.  
  16.     IF (GetVar('ENV:Sys/nv_location',nv_loc,120,0))>0
  17.  
  18.         IF lock:=Lock(nv_loc,ACCESS_READ)
  19.             oldlock:=CurrentDir(lock)
  20.             IF gethi(1) THEN outputhi(' Law ''n Justice\n\n')
  21.             IF gethi(2) THEN outputhi(' BabeWatch\n\n')
  22.             IF gethi(3) THEN outputhi(' Extreme Sports\n\n')
  23.             WriteF('\n')
  24.             CurrentDir(oldlock)
  25.             UnLock(lock)
  26.         ENDIF
  27.     ENDIF
  28. ENDPROC
  29.  
  30. PROC gethi(table)
  31. DEF filename[30]:ARRAY,fh
  32.     StringF(filename,'PinballIllusions/table00\d',table)
  33.     IF fh:=Open(filename,MODE_OLDFILE)
  34.         Read(fh,buff,50)
  35.         Close(fh)
  36.         RETURN 1
  37.     ENDIF
  38. ENDPROC 0
  39.  
  40. PROC outputhi(tablename)
  41. DEF name[3]:STRING,pos,score[14]:ARRAY,d
  42.  
  43.     WriteF('\n')
  44.     WriteF(tablename)
  45.  
  46.     pos:=0
  47.     WHILE pos<50
  48.         MidStr(name,buff,pos,3)
  49.         WriteF(' \d. ',pos/10+1)
  50.         WriteF('\s',name)
  51.  
  52.         CopyMem(buff+4+pos,score,14)
  53.         MOVE.L score,A0
  54.         d:=0
  55.         MOVE.L (A0),d
  56.         WriteF('\h[8]',d)
  57.  
  58.         MOVE.L score,A0
  59.         d:=0
  60.         MOVEQ #0,D0
  61.         MOVE.W 4(A0),D0
  62.         MOVE.L D0,d
  63.         WriteF('\z\h[4]\n',d)
  64.  
  65.         pos:=pos+10
  66.     ENDWHILE
  67. ENDPROC
  68.